<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>API接口</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="761128067">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "761128067";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("api.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建API接口"
  			,"inport":"导入API接口"
  			,"update":"修改API接口"
  			,"detail":"API接口详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#apiForm").form({
		"":function(){}
		,"srvApi.saId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvApi.saName":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "API名称不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "API名称最大长度为32个字符";
		}
		,"srvApi.saNamespace":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "名称空间不能为空";
			}
			if(el.value.length>128 && el.value.indexOf("[*]")==-1)
				return "名称空间最大长度为128个字符";
			if(jQuery.trim(el.value)!=""){
				var protocol = $.getAjax("api.query.do",{exists:true,saNamespace:el.value});
				if(protocol.success && protocol.data.list && protocol.data.list.length>0){
					if(!$("#saId").val() || protocol.data.list[0].key!=$("#saId").val())
						return "名称空间已存在";						
				}
			}
		}
		,"srvApi.saType":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvApi.saVersion":function(el){
		}
		,"srvApi.saOpen":function(el){
		}
		,"srvApi.saOauth":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择需要用户授权";
			}
		}
		,"srvApi.saDescript":function(el){
			if(el.value.length>128 && el.value.indexOf("[*]")==-1)
				return "接口说明最大长度为128个字符";
		}
		,"srvApi.saClass":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "接口类名不能为空";
			}
			if(el.value.length>64 && el.value.indexOf("[*]")==-1)
				return "接口类名最大长度为64个字符";
		}
		,"srvApi.saDir":function(el){
		}
		,"srvApi.saMethod":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "函数名称不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "函数名称最大长度为32个字符";
		}
		,"srvApi.saLog":function(el){
		}
		,"srvApi.saParams":function(el){
			if(el.value.length>65535 && el.value.indexOf("[*]")==-1)
				return "参数结构最大长度为65535个字符";
		}
		,"srvApi.saReturnStruct":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "返回结构不能为空";
			}
			if(el.value.length>65535 && el.value.indexOf("[*]")==-1)
				return "返回结构最大长度为65535个字符";
		}
		,"srvApi.saError":function(el){
			if(el.value.length>1024 && el.value.indexOf("[*]")==-1)
				return "错误代码最大长度为1024个字符";
		}
		,"srvApi.saUpdateTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "修改时间不能为空";
			}
		}
		,"srvApi.saAddTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "添加时间不能为空";
			}
		}
		,"srvApi.saStatus":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择状态";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvApi" id="apiForm" name="apiForm" target="jsoniframe" action="api.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写API接口相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("saId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saId"))))}}
	{{lz.set("saId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saId}}
	<dl lz:if="{{saId_editable||saId_readonly}}" class="saId hidden " major  ref="saId">
		<dt>编　　号:</dt>
		<dd lz:if="{{saId_editable}}" input="hidden">
			<lz:block lz:if="{{srvApi$saId}}">
				{{srvApi$saId}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saId}}">
			<input type="hidden" value="{{lz.htm(srvApi.saId)}}" name="srvApi.saId" id="saId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saId">{{srvApi.saId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saId$||srvApi.saId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saId}}
	{{lz.set("saName_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saName"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saName"))))}}
	{{lz.set("saName_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saName}}
	<dl lz:if="{{saName_editable||saName_readonly}}" class="saName  " major  ref="saName">
		<dt>API名称:</dt>
		<dd lz:if="{{saName_editable}}" input="text">
			<lz:block lz:if="{{srvApi$saName}}">
				{{srvApi$saName}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saName}}">
		 	<input type="text" class="input narrow"   name="srvApi.saName" id="saName"  value="{{lz.htm(srvApi.saName)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>中文描述</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saName_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saName">{{srvApi.saName}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saName$||srvApi.saName)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saName}}
	{{lz.set("saNamespace_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saNamespace"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saNamespace"))))}}
	{{lz.set("saNamespace_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saNamespace}}
	<dl lz:if="{{saNamespace_editable||saNamespace_readonly}}" class="saNamespace   wider" major  ref="saNamespace">
		<dt>名称空间:</dt>
		<dd lz:if="{{saNamespace_editable}}" input="textarea">
			<lz:block lz:if="{{srvApi$saNamespace}}">
				{{srvApi$saNamespace}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saNamespace}}">
		 	<textarea class="input wide"  id="saNamespace" name="srvApi.saNamespace" rows="5">{{srvApi.saNamespace}}</textarea>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>格式如:com.xxxx.xxx</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saNamespace_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvApi.saNamespace$||srvApi.saNamespace)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saNamespace}}
	{{lz.set("saType_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saType"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saType"))))}}
	{{lz.set("saType_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saType}}
	<dl lz:if="{{saType_editable||saType_readonly}}" class="saType  " major  ref="saType">
		<dt>接口分类:</dt>
		<dd lz:if="{{saType_editable}}" input="tree">
			<lz:block lz:if="{{srvApi$saType}}">
				{{srvApi$saType}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saType}}">
		  			<select class="tree narrow"  id="saType" name="srvApi.saType" action="/admin/api/apitype.query.do?parenter={param}">
						<option value="{{lz.htm(srvApi.saType)}}">{{srvApi.saType$||srvApi.saType}}</option>
					</select>			  		
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API接口的接口分类</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saType_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saType">{{srvApi.saType}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/api/apitype.details.html?key=srvApi.saType}')">
			 {{lz.html(srvApi.saType$||srvApi.saType)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saType}}
	{{lz.set("saVersion_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saVersion"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saVersion"))))}}
	{{lz.set("saVersion_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saVersion}}
	<dl lz:if="{{saVersion_editable||saVersion_readonly}}" class="ribs saVersion  " major  ref="saVersion">
		<dt>版 本 号:</dt>
		<dd lz:if="{{saVersion_editable}}" input="select">
			<lz:block lz:if="{{srvApi$saVersion}}">
				{{srvApi$saVersion}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saVersion}}">
		 	<select class="narrow" id="saVersion" name="srvApi.saVersion">
		 		<option value="">请选择</option>
				<option value="1" selected='{{srvApi.saVersion=="1"?"selected":""}}'>V1</option>
				<option value="2" selected='{{srvApi.saVersion=="2"?"selected":""}}'>V2</option>
				<option value="3" selected='{{srvApi.saVersion=="3"?"selected":""}}'>V3</option>
		 	</select>
	 	 </lz:block>
	 	 
	 	 <em>请选择API接口的版本号</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saVersion_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saVersion">{{srvApi.saVersion}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saVersion$||srvApi.saVersion)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saVersion}}
	{{lz.set("saOpen_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saOpen"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saOpen"))))}}
	{{lz.set("saOpen_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saOpen}}
	<dl lz:if="{{saOpen_editable||saOpen_readonly}}" class="ribs saOpen  " major  ref="saOpen">
		<dt>是否开放:</dt>
		<dd lz:if="{{saOpen_editable}}" input="select">
			<lz:block lz:if="{{srvApi$saOpen}}">
				{{srvApi$saOpen}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saOpen}}">
		 	<select class="narrow" id="saOpen" name="srvApi.saOpen">
		 		<option value="">请选择</option>
				<option value="1" selected='{{srvApi.saOpen=="1"?"selected":""}}'>开放</option>
				<option value="0" selected='{{srvApi.saOpen=="0"?"selected":""}}'>非开放</option>
		 	</select>
	 	 </lz:block>
	 	 
	 	 <em>请选择API接口的是否开放</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saOpen_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saOpen">{{srvApi.saOpen}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saOpen$||srvApi.saOpen)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saOpen}}
	{{lz.set("saOauth_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saOauth"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saOauth"))))}}
	{{lz.set("saOauth_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saOauth}}
	<dl lz:if="{{saOauth_editable||saOauth_readonly}}" class="saOauth  " major  ref="saOauth">
		<dt>需要用户授权:</dt>
		<dd lz:if="{{saOauth_editable}}" input="select">
			<lz:block lz:if="{{srvApi$saOauth}}">
				{{srvApi$saOauth}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saOauth}}">
		 	<select class="narrow" id="saOauth" name="srvApi.saOauth">
		 		<option value="">请选择</option>
				<option value="0" selected='{{srvApi.saOauth=="0"?"selected":""}}'>无需授权</option>
				<option value="1" selected='{{srvApi.saOauth=="1"?"selected":""}}'>需要授权</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API接口的需要用户授权</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saOauth_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saOauth">{{srvApi.saOauth}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saOauth$||srvApi.saOauth)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saOauth}}
	{{lz.set("saDescript_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saDescript"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saDescript"))))}}
	{{lz.set("saDescript_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saDescript}}
	<dl lz:if="{{saDescript_editable||saDescript_readonly}}" class="ribs saDescript   mider" minor  ref="saDescript">
		<dt>接口说明:</dt>
		<dd lz:if="{{saDescript_editable}}" input="text">
			<lz:block lz:if="{{srvApi$saDescript}}">
				{{srvApi$saDescript}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saDescript}}">
		 	<input type="text" class="input mide"  maxlength="128" name="srvApi.saDescript" id="saDescript"  value="{{lz.htm(srvApi.saDescript)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入API接口的接口说明</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saDescript_readonly}}">
		 	<div class="state-input mide">
		 		<textarea class=""  style="display:none;" id="saDescript">{{srvApi.saDescript}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saDescript$||srvApi.saDescript)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saDescript}}
	{{lz.set("saClass_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saClass"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saClass"))))}}
	{{lz.set("saClass_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saClass}}
	<dl lz:if="{{saClass_editable||saClass_readonly}}" class="saClass   mider" major  ref="saClass">
		<dt>接口类名:</dt>
		<dd lz:if="{{saClass_editable}}" input="text">
			<lz:block lz:if="{{srvApi$saClass}}">
				{{srvApi$saClass}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saClass}}">
		 	<input type="text" class="input mide"  maxlength="64" name="srvApi.saClass" id="saClass"  value="{{lz.htm(srvApi.saClass)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>脚本代码为java代码,参数结构中定义的变量名可直接使用,有错误返回错误代码，没错误无需返回</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saClass_readonly}}">
		 	<div class="state-input mide">
		 		<textarea class=""  style="display:none;" id="saClass">{{srvApi.saClass}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saClass$||srvApi.saClass)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saClass}}
	{{lz.set("saDir_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saDir"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saDir"))))}}
	{{lz.set("saDir_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saDir}}
	<dl lz:if="{{saDir_editable||saDir_readonly}}" class="ribs saDir  " major  ref="saDir">
		<dt>数据方向:</dt>
		<dd lz:if="{{saDir_editable}}" input="select">
			<lz:block lz:if="{{srvApi$saDir}}">
				{{srvApi$saDir}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saDir}}">
		 	<select class="narrow" id="saDir" name="srvApi.saDir">
		 		<option value="">请选择</option>
				<option value="0" selected='{{srvApi.saDir=="0"?"selected":""}}'>请求</option>
				<option value="1" selected='{{srvApi.saDir=="1"?"selected":""}}'>推送</option>
		 	</select>
	 	 </lz:block>
	 	 
	 	 <em>请选择API接口的数据方向</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saDir_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saDir">{{srvApi.saDir}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saDir$||srvApi.saDir)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saDir}}
	{{lz.set("saMethod_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saMethod"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saMethod"))))}}
	{{lz.set("saMethod_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saMethod}}
	<dl lz:if="{{saMethod_editable||saMethod_readonly}}" class="saMethod  " major  ref="saMethod">
		<dt>函数名称:</dt>
		<dd lz:if="{{saMethod_editable}}" input="text">
			<lz:block lz:if="{{srvApi$saMethod}}">
				{{srvApi$saMethod}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saMethod}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvApi.saMethod" id="saMethod"  value="{{lz.htm(srvApi.saMethod)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入API接口的函数名称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saMethod_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saMethod">{{srvApi.saMethod}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saMethod$||srvApi.saMethod)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saMethod}}
	{{lz.set("saLog_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saLog"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saLog"))))}}
	{{lz.set("saLog_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saLog}}
	<dl lz:if="{{saLog_editable||saLog_readonly}}" class="ribs saLog  " major  ref="saLog">
		<dt>记录日志:</dt>
		<dd lz:if="{{saLog_editable}}" input="select">
			<lz:block lz:if="{{srvApi$saLog}}">
				{{srvApi$saLog}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saLog}}">
		 	<select class="narrow" id="saLog" name="srvApi.saLog">
		 		<option value="">请选择</option>
				<option value="0" selected='{{srvApi.saLog=="0"?"selected":""}}'>否</option>
				<option value="1" selected='{{srvApi.saLog=="1"?"selected":""}}'>是</option>
		 	</select>
	 	 </lz:block>
	 	 
	 	 <em>请选择API接口的记录日志</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saLog_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saLog">{{srvApi.saLog}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saLog$||srvApi.saLog)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saLog}}
	{{lz.set("saParams_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saParams"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saParams"))))}}
	{{lz.set("saParams_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saParams}}
	<dl lz:if="{{saParams_editable||saParams_readonly}}" class="ribs saParams   wider" minor  ref="saParams">
		<dt>参数结构:</dt>
		<dd lz:if="{{saParams_editable}}" input="textarea">
			<lz:block lz:if="{{srvApi$saParams}}">
				{{srvApi$saParams}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saParams}}">
		 	<textarea class="input wide"  id="saParams" name="srvApi.saParams" rows="5">{{srvApi.saParams}}</textarea>
	 	 </lz:block>
	 	 
	 	 <em>请输入API接口的参数结构</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saParams_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvApi.saParams$||srvApi.saParams)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saParams}}
	{{lz.set("saReturnStruct_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saReturnStruct"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saReturnStruct"))))}}
	{{lz.set("saReturnStruct_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saReturnStruct}}
	<dl lz:if="{{saReturnStruct_editable||saReturnStruct_readonly}}" class="saReturnStruct   wider" major  ref="saReturnStruct">
		<dt>返回结构:</dt>
		<dd lz:if="{{saReturnStruct_editable}}" input="textarea">
			<lz:block lz:if="{{srvApi$saReturnStruct}}">
				{{srvApi$saReturnStruct}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saReturnStruct}}">
		 	<textarea class="input wide"  id="saReturnStruct" name="srvApi.saReturnStruct" rows="5">{{srvApi.saReturnStruct}}</textarea>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入API接口的返回结构</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saReturnStruct_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvApi.saReturnStruct$||srvApi.saReturnStruct)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saReturnStruct}}
	{{lz.set("saError_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saError"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saError"))))}}
	{{lz.set("saError_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saError}}
	<dl lz:if="{{saError_editable||saError_readonly}}" class="ribs saError   wider" minor  ref="saError">
		<dt>错误代码:</dt>
		<dd lz:if="{{saError_editable}}" input="textarea">
			<lz:block lz:if="{{srvApi$saError}}">
				{{srvApi$saError}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saError}}">
		 	<textarea class="input wide"  id="saError" name="srvApi.saError" rows="5">{{srvApi.saError}}</textarea>
	 	 </lz:block>
	 	 
	 	 <em>请输入API接口的错误代码</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saError_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvApi.saError$||srvApi.saError)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saError}}
	{{lz.set("saUpdateTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saUpdateTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"saUpdateTime"))))}}
	{{lz.set("saUpdateTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saUpdateTime}}
	<dl lz:if="{{saUpdateTime_editable||saUpdateTime_readonly}}" class="saUpdateTime  " major  ref="saUpdateTime">
		<dt>修改时间:</dt>
		<dd lz:if="{{saUpdateTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvApi$saUpdateTime}}">
				{{srvApi$saUpdateTime}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saUpdateTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvApi.saUpdateTime" id="saUpdateTime"  value="{{srvApi.saUpdateTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API接口的修改时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saUpdateTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saUpdateTime">{{srvApi.saUpdateTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saUpdateTime$||srvApi.saUpdateTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saUpdateTime}}
	{{lz.set("saAddTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saAddTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"saAddTime"))))}}
	{{lz.set("saAddTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saAddTime}}
	<dl lz:if="{{saAddTime_editable||saAddTime_readonly}}" class="saAddTime  " major  ref="saAddTime">
		<dt>添加时间:</dt>
		<dd lz:if="{{saAddTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvApi$saAddTime}}">
				{{srvApi$saAddTime}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saAddTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvApi.saAddTime" id="saAddTime"  value="{{srvApi.saAddTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API接口的添加时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saAddTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saAddTime">{{srvApi.saAddTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saAddTime$||srvApi.saAddTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saAddTime}}
	{{lz.set("saStatus_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saStatus"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"saStatus"))))}}
	{{lz.set("saStatus_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saStatus}}
	<dl lz:if="{{saStatus_editable||saStatus_readonly}}" class="saStatus  " major  ref="saStatus">
		<dt>状　　态:</dt>
		<dd lz:if="{{saStatus_editable}}" input="select">
			<lz:block lz:if="{{srvApi$saStatus}}">
				{{srvApi$saStatus}}
			</lz:block>
			<lz:block lz:if="{{!srvApi$saStatus}}">
		 	<select class="narrow" id="saStatus" name="srvApi.saStatus">
		 		<option value="">请选择</option>
				<option value="0" selected='{{srvApi.saStatus=="0"?"selected":""}}'>测试中</option>
				<option value="1" selected='{{srvApi.saStatus=="1"?"selected":""}}'>正常</option>
				<option value="2" selected='{{srvApi.saStatus=="2"?"selected":""}}'>禁用</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API接口的状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saStatus_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saStatus">{{srvApi.saStatus}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApi.saStatus$||srvApi.saStatus)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saStatus}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvApi.saId}}" name="srvApi.saId" id="saId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/api/api.edit.html?edittype=update&id={{srvApi.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteApi('{{srvApi.id}}','{{srvApi.saName}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/api/api.edit.html",document.title,"/admin//images/icons/2008825642250778015.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/api/api.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除API接口
	**/
	function deleteApi(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除API接口",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/api/api.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>